html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    position: relative;
    z-index: 1;
    background: url("../static/login_bg.png") no-repeat center center fixed;
    background-size: cover;
    overflow: hidden;
}

body::before {  
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 0;
}

header {
    position: relative;
    z-index: 2;
    background-color: #f5f5f5;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-title {
    position: relative;
    z-index: 3;
    display: block;
    margin: 50px auto -80px;
}

.container {
    background: #ffffff;
    padding: 30px;
    border-radius: 15px;
    max-width: 320px;
    margin: 20px auto;
    position: relative;
    z-index: 2;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.form-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: var(--light-bg);
    border-radius: 25px;
    padding: 3px;
    position: relative;
    overflow: hidden;
    width: 220px;
    margin-left: auto;
    margin-right: auto;
}

.form-toggle button {
    background: none;
    border: none;
    color: var(--dark-text);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    flex: 1;
}

.form-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: #ffffff;
    border-radius: 22px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-toggle.register::after {
    left: calc(50% + 3px);
}

.form-toggle button.active {
    color: var(--tech-blue);
    font-weight: bold;
}

.character {
    position: absolute;
    width: 100px;  
    height: 100px;
    background-size: contain;
    background-repeat: no-repeat;
    filter: brightness(90%);
}

.walk {
    animation: walk 10s infinite linear;
}

.jump {
    animation: jump 2s infinite;
}

.wave {
    animation: wave 3s infinite;
}

.lie {
    animation: lie 5s infinite;
}

@keyframes walk {
    0% { left: 0; }
    100% { left: calc(100% - 50px); }
}

@keyframes jump {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-30px); }
    60% { transform: translateY(-15px); }
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(20deg); }
}

@keyframes lie {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
}

nav ul li {
    margin-left: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #0056b3;
}

h1, h2 {
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 40px;
    color: #06C05F;
}

h2 {
    font-size: 20px;
    color: #06C05F;
}

.container h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

.container form {
    width: 100%;
    margin: 0 auto;
    margin-bottom: 20px;
}

.container form label {
    display: block;
    margin-bottom: 5px;
    color: var(--dark-text);
    text-align: left;
    font-size: 14px;
}

.container form input[type="text"],
.container form input[type="password"],
.container form input[type="submit"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.container form input[type="text"]:focus,
.container form input[type="password"]:focus {
    border-color: var(--tech-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.2);
}

.container form input[type="submit"] {
    background: var(--tech-green);
    color: white;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    font-size: 16px;
    font-weight: bold;
}

.container form input[type="submit"]:hover {
    background: #09c271;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(9, 194, 113, 0.3);
}

/* Login specific styles */
.container form[action="/login"] input[type="submit"] {
    background-color: #06C05F;
    color: #fff;
}

.container form[action="/login"] input[type="submit"]:hover {
    background-color: #05a050;
}

/* Register specific styles */
.container form[action="/register"] input[type="submit"] {
    background-color: #3498db;
    color: #fff;
}

.container form[action="/register"] input[type="submit"]:hover {
    background-color: #2980b9;
}

.container a,
.logout-link {
    color: #06C05F;
    text-decoration: none;
}

.container a:hover,
.logout-link:hover {
    text-decoration: underline;
}

.login-title {
    max-width: 300px;
    width: 80%;
    margin: 20px auto 10px;
    display: block;
}

@media (max-height: 600px) {
    .login-title {
        max-width: 200px;
        margin: 10px auto 5px;
    }
    
    .container {
        margin: 10px auto;
        padding: 15px;
    }
    
    .container h2 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .container form input[type="submit"] {
        padding: 8px;
    }
}

.error-message {
    color: red;
    margin-bottom: 10px;
    text-align: center;
}